#ifndef __MARS_GRAPHICS_VRAM_BUFFER_H__
#define __MARS_GRAPHICS_VRAM_BUFFER_H__

#include "MarsType.h"

namespace Graphics
{

class VRamBuffer
{
public:
	enum BufferType
	{
		BufferType_Unknown			= -1,
		BufferType_Vertex			= 0,
		BufferType_Index			= 1,
		BufferType_Constant			= 2,
	};

									VRamBuffer( BufferType type, D3D11_USAGE usage );
									~VRamBuffer();

	bool							Create( void* pMem, Core::uint32 iSize );
	void							Delete();

	bool							IsUsing() const;
	void							SetUsing( bool bUsing );

	ID3D11Buffer*					GetNativeBuffer();

private:
	void							UnloadVRamBuffer();

	BufferType						m_eBufferType;
	D3D11_USAGE						m_eUsage;
	ID3D11Buffer*					m_pBuffer;

	bool							m_bUsing;
};

inline ID3D11Buffer* VRamBuffer::GetNativeBuffer()
{
	return m_pBuffer;
}

inline bool VRamBuffer::IsUsing() const
{
	return m_bUsing;
}

inline void VRamBuffer::SetUsing( bool bUsing )
{
	m_bUsing = bUsing;
}

} // end of namespace Graphics

#endif // end of #ifndef __MARS_GRAPHICS_VRAM_BUFFER_H__